package com.shumi.fun;

import com.shumi.enums.IReturnEnum;

/**
 * 将业务返回类型转换为web返回对象
 * */
public class ReturnEnumTransform {

    public static WebResult transform(IReturnEnum returnEnum){
        WebResult result=new WebResult();
        result.setResultCode(returnEnum.getCode());
        result.setResultMsg(returnEnum.getMessage());
        result.setSuccess(returnEnum.isSuccess());
        result.setResultData(returnEnum.getReturnObject());
        return  result;
    }
}
